package org.flowers.unbeaten.controller;


import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.flowers.unbeaten.base.entity.BaseEntity;
import org.flowers.unbeaten.base.entity.Log;
import org.flowers.unbeaten.logging.aop.annotation.Logging;
import org.flowers.unbeaten.logging.aop.enums.BusinessType;
import org.flowers.unbeaten.service.ILogService;
import org.flowers.unbeaten.util.DataResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 日志 前端控制器
 * </p>
 *
 * @author RyanWang
 * @since 2021-07-16
 */
@Api(tags = "后台系统-日志管理")
@RestController
@RequestMapping("/log/log")
public class LogController {

    @Autowired
    private ILogService logService;

    @PostMapping("/list")
    @ApiOperation(value = "分页获取日志列表接口")
    @RequiresPermissions("log:log:list")
    @Logging(title = "日志管理", describe = "分页获取日志列表", type = BusinessType.QUERY)
    public DataResult list(@RequestBody Log log, BaseEntity baseEntity) {
        return DataResult.success(logService.getLogPageList(log, baseEntity));
    }

}

